package com.sunny.ynhz.ui.patrol;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;

import com.amap.api.maps.AMap;
import com.amap.api.maps.MapView;
import com.sunny.ynhz.R;
import com.sunny.ynhz.adapter.ProblemListAdapter;
import com.sunny.ynhz.ui.base.AppBaseTranslationTitleBarActivity;
import com.sunny.ynhz.bean.ProblemBean;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by luao on 2017/7/20.
 */

public class PatrolDetailActivity extends AppBaseTranslationTitleBarActivity {
    @BindView(R.id.patrol_detail_map)
    MapView patrolDetailMap;
    @BindView(R.id.patrol_problem_recyclerview)
    RecyclerView patrolProblemRecyclerview;
    private AMap aMap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_patrol_detail);
        ButterKnife.bind(this);
        patrolDetailMap.onCreate(savedInstanceState);// 此方法必须重写
        aMap = patrolDetailMap.getMap();

        RecyclerView.LayoutManager layoutManager = new RecyclerView.LayoutManager() {
            @Override
            public RecyclerView.LayoutParams generateDefaultLayoutParams() {
                return null;
            }
        };

        LinkedList<ProblemBean.DataBean> problemList = new LinkedList<>();
        patrolProblemRecyclerview.setLayoutManager(layoutManager);
        ProblemListAdapter problemListAdapter = new ProblemListAdapter(problemList);
        patrolProblemRecyclerview.setAdapter(problemListAdapter);
    }

    @Override
    protected void onResume() {
        patrolDetailMap.onResume();
        super.onResume();
    }

    @Override
    protected void onDestroy() {
        patrolDetailMap.onDestroy();
        super.onDestroy();
    }
}
